#ifndef GOWILDDEVICE_H
#define GOWILDDEVICE_H

#include "BaseDevice.h"
#include "DataType/GowildStruct.h"
#include "DataType/ControlPointStruct.h"
#include "File/Ini/PointIni.h"
#include "System/System.h"

#include"Protocol/GowildProtocol.h"
#include "Command/GowildProtocol/GowildSearchCmd.h"
#include "Command/GowildProtocol/GowildControlCmd.h"
#include "Command/GowildProtocol/GowildRequestHeartbeatCmd.h"
#include "Command/GowildProtocol/GowildResponseHeartbeatCmd.h"
#include "Command/GowildProtocol/GowildRequestDeviceListCmd.h"
#include "Command/GowildProtocol/GowildResponseDeviceListCmd.h"
#include "Command/GowildProtocol/GowildRequestSceneListCmd.h"
#include "Command/GowildProtocol/GowildResponseSceneListCmd.h"
#include "Command/GowildProtocol/GowildRequestRoomListCmd.h"
#include "Command/GowildProtocol/GowildResponseRoomListCmd.h"
#include "Command/GowildProtocol/GowildRequestFloorListCmd.h"
#include "Command/GowildProtocol/GowildResponseFloorListCmd.h"

#include "Function/ControlPointFunc.h"

class GowildDevice : BaseInterface<GowildDevice>
{
    Q_OBJECT
public:
    Q_INVOKABLE explicit GowildDevice(QObject *parent = 0);

private:

    QMultiHash<QString,PointStruct> m_pointHash;
    QHash<int,QString> m_zoneHash;

    QHash<QString,QString> m_deviceTypeHash;
    QHash<QString,QString> m_stateHash;
    QHash<QString,QString> m_modeHash;
    QHash<QString,QString> m_attributeHash;
    QHash<int,QString> m_roomHash;
    QHash<int,Gowild::SceneStruct> m_sceneHash;
    QHash<int,Gowild::DeviceStruct> m_deviceHash;

    QHash<int,QString> roomHash();
    QHash<int,Gowild::SceneStruct> sceneHash();
    QHash<int,Gowild::DeviceStruct> deviceHash();


     GowildProtocol *gowildProtocol;

     void gowildSearchCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildRequestHeartbeatCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildRequestDeviceListCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildRequestSceneListCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildRequestRoomListCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildRequestFloorListCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);
     void gowildControlCmdHandle(PortStruct source,QSharedPointer<BaseCmd> sharedCmd);

};

#endif // GOWILDDEVICE_H
